package com.wishu.finance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.Data;

/**
 * 收款计划表
 *
 * @TableName t_cw_receipt_plan
 */
@TableName(value = "t_cw_receipt_plan")
@Data
public class TCwReceiptPlan implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 收款单号
     */
    private String receiptOrderNo;

    /**
     * 商户ID
     */
    private Long businessId;

    /**
     * 合同ID
     */
    private Long contractId;

    /**
     * 合同编号
     */
    private String contractNo;

    /**
     * 合同类型
     * ,"1：收房合同，
     * 2：出房合同"
     */
    private Integer contractType;

    /**
     * 解约协议ID（解约时才有，收房是收房解约协议，出房是出房解约协议）
     */
    private Long tTerminationId;

    /**
     * 楼盘ID
     */
    private Long premiseId;

    /**
     * 小区(使用楼盘名)
     */
    private String premiseName;

    /**
     * 房源ID
     */
    private String roomId;

    /**
     * 房源编号
     */
    private String roomCode;

    /**
     * 承租房间(使用房源名称)
     */
    private String roomName;

    /**
     * 业主ID
     */
    private Long ownerId;

    /**
     * 业主姓名
     */
    private String ownerName;

    /**
     * 租客ID
     */
    private Long tenantId;

    /**
     * 租客姓名(面向业主收款时，为空)
     */
    private String tenantName;

    /**
     * 收款类型
     * ,1:房租收款 2：租务收款 3：解约结算收款 4：续约结算收款
     */
    private Integer receiptType;

    /**
     * 收款状态
     * 1:未收款 2：已收款 3：已中止  4：已冻结（未收款的时候，才会变成已冻结，所以恢复冻结状态的时候，是恢复成未收款状态）
     */
    private Integer skStatus;

    /**
     * 账单类型（金融属性）,"1：分期变更
     * 2：租约保理变更
     * 3：退租变更
     * 4：普通账单(正常房租租务计划)"
     * 参照枚举CollectionPlanZdType
     */
    private Integer billType;

    /**
     * 款项（费用类型）
     * ,1:水费 2：电费，3：煤/燃气费，80：租金，81：押金，90：解约结算，99:其它
     */
    private Integer itemType;

    /**
     * 其它款项
     * ,款项为其它的时候，输入
     */
    private String otherItemName;

    /**
     * 支付金额（应收金额，房租时=不含税净价+税费）
     */
    private BigDecimal paymentAmount;

    /**
     * 实收金额
     */
    private BigDecimal realPaymentAmount;

    /**
     * 选择账期（跟随的第几期房租对应的收款计划ID）,跟随一起付款的时候，应付日期选择设置为同一天
     */
    private Long withReceiptPlanId;

    /**
     * 账期开始日
     */
    private Date paymentDaysBegin;

    /**
     * 账期截止日
     */
    private Date paymentDaysEnd;

    /**
     * 预定收款日期
     */
    private Date collectionDate;

    /**
     * 实际收款日期
     */
    private Date realCollectionDate;

    /**
     * 第几期（房租收款的时候）
     */
    private Integer receiptNumber;

    /**
     * 线下支付方式（直接录入已收款的收款计划时选择的）
     * ,1:快捷同，2：支付宝，3：微信，4：现金，5：银行卡转账，6：POS机刷卡，99：其它
     */
    private Integer payMethod;

    /**
     * 其它支付方式
     * ,支付方式为其它的时候，输入
     */
    private String otherPayMethod;

    /**
     * 支付流水号（线下直接录入收款的时候输入，不是线上的流水号）
     */
    private String payFlowNo;

    /**
     * 账期房租金额（净价，不含税）
     */
    private BigDecimal rentalPrice;

    /**
     * 税费
     */
    private BigDecimal tax;

    /**
     * 操作人
     */
    private String operationUser;

    /**
     * 备注
     */
    private String remark;

    /**
     * 预留字段1
     */
    private BigDecimal reserve1;

    /**
     * 预留字段2
     */
    private Integer reserve2;

    /**
     * 预留字段3
     */
    private String reserve3;

    /**
     * 预留字段4
     */
    private String reserve4;

    /**
     * 预留字段5
     */
    private String reserve5;

    /**
     * 删除标识
     * ,0:未删除，1：删除
     */
    private Integer delFlg;

    /**
     * 创建用户ID
     */
    private Long createUserid;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新用户ID
     */
    private Long updateUserid;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TCwReceiptPlan other = (TCwReceiptPlan) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getReceiptOrderNo() == null ? other.getReceiptOrderNo() == null : this.getReceiptOrderNo().equals(other.getReceiptOrderNo()))
                && (this.getBusinessId() == null ? other.getBusinessId() == null : this.getBusinessId().equals(other.getBusinessId()))
                && (this.getContractId() == null ? other.getContractId() == null : this.getContractId().equals(other.getContractId()))
                && (this.getContractNo() == null ? other.getContractNo() == null : this.getContractNo().equals(other.getContractNo()))
                && (this.getContractType() == null ? other.getContractType() == null : this.getContractType().equals(other.getContractType()))
                && (this.getTTerminationId() == null ? other.getTTerminationId() == null : this.getTTerminationId().equals(other.getTTerminationId()))
                && (this.getPremiseId() == null ? other.getPremiseId() == null : this.getPremiseId().equals(other.getPremiseId()))
                && (this.getPremiseName() == null ? other.getPremiseName() == null : this.getPremiseName().equals(other.getPremiseName()))
                && (this.getRoomId() == null ? other.getRoomId() == null : this.getRoomId().equals(other.getRoomId()))
                && (this.getRoomCode() == null ? other.getRoomCode() == null : this.getRoomCode().equals(other.getRoomCode()))
                && (this.getRoomName() == null ? other.getRoomName() == null : this.getRoomName().equals(other.getRoomName()))
                && (this.getOwnerId() == null ? other.getOwnerId() == null : this.getOwnerId().equals(other.getOwnerId()))
                && (this.getOwnerName() == null ? other.getOwnerName() == null : this.getOwnerName().equals(other.getOwnerName()))
                && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()))
                && (this.getTenantName() == null ? other.getTenantName() == null : this.getTenantName().equals(other.getTenantName()))
                && (this.getReceiptType() == null ? other.getReceiptType() == null : this.getReceiptType().equals(other.getReceiptType()))
                && (this.getSkStatus() == null ? other.getSkStatus() == null : this.getSkStatus().equals(other.getSkStatus()))
                && (this.getBillType() == null ? other.getBillType() == null : this.getBillType().equals(other.getBillType()))
                && (this.getItemType() == null ? other.getItemType() == null : this.getItemType().equals(other.getItemType()))
                && (this.getOtherItemName() == null ? other.getOtherItemName() == null : this.getOtherItemName().equals(other.getOtherItemName()))
                && (this.getPaymentAmount() == null ? other.getPaymentAmount() == null : this.getPaymentAmount().equals(other.getPaymentAmount()))
                && (this.getRealPaymentAmount() == null ? other.getRealPaymentAmount() == null : this.getRealPaymentAmount().equals(other.getRealPaymentAmount()))
                && (this.getWithReceiptPlanId() == null ? other.getWithReceiptPlanId() == null : this.getWithReceiptPlanId().equals(other.getWithReceiptPlanId()))
                && (this.getPaymentDaysBegin() == null ? other.getPaymentDaysBegin() == null : this.getPaymentDaysBegin().equals(other.getPaymentDaysBegin()))
                && (this.getPaymentDaysEnd() == null ? other.getPaymentDaysEnd() == null : this.getPaymentDaysEnd().equals(other.getPaymentDaysEnd()))
                && (this.getCollectionDate() == null ? other.getCollectionDate() == null : this.getCollectionDate().equals(other.getCollectionDate()))
                && (this.getRealCollectionDate() == null ? other.getRealCollectionDate() == null : this.getRealCollectionDate().equals(other.getRealCollectionDate()))
                && (this.getReceiptNumber() == null ? other.getReceiptNumber() == null : this.getReceiptNumber().equals(other.getReceiptNumber()))
                && (this.getPayMethod() == null ? other.getPayMethod() == null : this.getPayMethod().equals(other.getPayMethod()))
                && (this.getOtherPayMethod() == null ? other.getOtherPayMethod() == null : this.getOtherPayMethod().equals(other.getOtherPayMethod()))
                && (this.getPayFlowNo() == null ? other.getPayFlowNo() == null : this.getPayFlowNo().equals(other.getPayFlowNo()))
                && (this.getRentalPrice() == null ? other.getRentalPrice() == null : this.getRentalPrice().equals(other.getRentalPrice()))
                && (this.getTax() == null ? other.getTax() == null : this.getTax().equals(other.getTax()))
                && (this.getOperationUser() == null ? other.getOperationUser() == null : this.getOperationUser().equals(other.getOperationUser()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getReserve1() == null ? other.getReserve1() == null : this.getReserve1().equals(other.getReserve1()))
                && (this.getReserve2() == null ? other.getReserve2() == null : this.getReserve2().equals(other.getReserve2()))
                && (this.getReserve3() == null ? other.getReserve3() == null : this.getReserve3().equals(other.getReserve3()))
                && (this.getReserve4() == null ? other.getReserve4() == null : this.getReserve4().equals(other.getReserve4()))
                && (this.getReserve5() == null ? other.getReserve5() == null : this.getReserve5().equals(other.getReserve5()))
                && (this.getDelFlg() == null ? other.getDelFlg() == null : this.getDelFlg().equals(other.getDelFlg()))
                && (this.getCreateUserid() == null ? other.getCreateUserid() == null : this.getCreateUserid().equals(other.getCreateUserid()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateUserid() == null ? other.getUpdateUserid() == null : this.getUpdateUserid().equals(other.getUpdateUserid()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getReceiptOrderNo() == null) ? 0 : getReceiptOrderNo().hashCode());
        result = prime * result + ((getBusinessId() == null) ? 0 : getBusinessId().hashCode());
        result = prime * result + ((getContractId() == null) ? 0 : getContractId().hashCode());
        result = prime * result + ((getContractNo() == null) ? 0 : getContractNo().hashCode());
        result = prime * result + ((getContractType() == null) ? 0 : getContractType().hashCode());
        result = prime * result + ((getTTerminationId() == null) ? 0 : getTTerminationId().hashCode());
        result = prime * result + ((getPremiseId() == null) ? 0 : getPremiseId().hashCode());
        result = prime * result + ((getPremiseName() == null) ? 0 : getPremiseName().hashCode());
        result = prime * result + ((getRoomId() == null) ? 0 : getRoomId().hashCode());
        result = prime * result + ((getRoomCode() == null) ? 0 : getRoomCode().hashCode());
        result = prime * result + ((getRoomName() == null) ? 0 : getRoomName().hashCode());
        result = prime * result + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
        result = prime * result + ((getOwnerName() == null) ? 0 : getOwnerName().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        result = prime * result + ((getTenantName() == null) ? 0 : getTenantName().hashCode());
        result = prime * result + ((getReceiptType() == null) ? 0 : getReceiptType().hashCode());
        result = prime * result + ((getSkStatus() == null) ? 0 : getSkStatus().hashCode());
        result = prime * result + ((getBillType() == null) ? 0 : getBillType().hashCode());
        result = prime * result + ((getItemType() == null) ? 0 : getItemType().hashCode());
        result = prime * result + ((getOtherItemName() == null) ? 0 : getOtherItemName().hashCode());
        result = prime * result + ((getPaymentAmount() == null) ? 0 : getPaymentAmount().hashCode());
        result = prime * result + ((getRealPaymentAmount() == null) ? 0 : getRealPaymentAmount().hashCode());
        result = prime * result + ((getWithReceiptPlanId() == null) ? 0 : getWithReceiptPlanId().hashCode());
        result = prime * result + ((getPaymentDaysBegin() == null) ? 0 : getPaymentDaysBegin().hashCode());
        result = prime * result + ((getPaymentDaysEnd() == null) ? 0 : getPaymentDaysEnd().hashCode());
        result = prime * result + ((getCollectionDate() == null) ? 0 : getCollectionDate().hashCode());
        result = prime * result + ((getRealCollectionDate() == null) ? 0 : getRealCollectionDate().hashCode());
        result = prime * result + ((getReceiptNumber() == null) ? 0 : getReceiptNumber().hashCode());
        result = prime * result + ((getPayMethod() == null) ? 0 : getPayMethod().hashCode());
        result = prime * result + ((getOtherPayMethod() == null) ? 0 : getOtherPayMethod().hashCode());
        result = prime * result + ((getPayFlowNo() == null) ? 0 : getPayFlowNo().hashCode());
        result = prime * result + ((getRentalPrice() == null) ? 0 : getRentalPrice().hashCode());
        result = prime * result + ((getTax() == null) ? 0 : getTax().hashCode());
        result = prime * result + ((getOperationUser() == null) ? 0 : getOperationUser().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getReserve1() == null) ? 0 : getReserve1().hashCode());
        result = prime * result + ((getReserve2() == null) ? 0 : getReserve2().hashCode());
        result = prime * result + ((getReserve3() == null) ? 0 : getReserve3().hashCode());
        result = prime * result + ((getReserve4() == null) ? 0 : getReserve4().hashCode());
        result = prime * result + ((getReserve5() == null) ? 0 : getReserve5().hashCode());
        result = prime * result + ((getDelFlg() == null) ? 0 : getDelFlg().hashCode());
        result = prime * result + ((getCreateUserid() == null) ? 0 : getCreateUserid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUserid() == null) ? 0 : getUpdateUserid().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", receiptOrderNo=").append(receiptOrderNo);
        sb.append(", businessId=").append(businessId);
        sb.append(", contractId=").append(contractId);
        sb.append(", contractNo=").append(contractNo);
        sb.append(", contractType=").append(contractType);
        sb.append(", tTerminationId=").append(tTerminationId);
        sb.append(", premiseId=").append(premiseId);
        sb.append(", premiseName=").append(premiseName);
        sb.append(", roomId=").append(roomId);
        sb.append(", roomCode=").append(roomCode);
        sb.append(", roomName=").append(roomName);
        sb.append(", ownerId=").append(ownerId);
        sb.append(", ownerName=").append(ownerName);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", tenantName=").append(tenantName);
        sb.append(", receiptType=").append(receiptType);
        sb.append(", skStatus=").append(skStatus);
        sb.append(", billType=").append(billType);
        sb.append(", itemType=").append(itemType);
        sb.append(", otherItemName=").append(otherItemName);
        sb.append(", paymentAmount=").append(paymentAmount);
        sb.append(", realPaymentAmount=").append(realPaymentAmount);
        sb.append(", withReceiptPlanId=").append(withReceiptPlanId);
        sb.append(", paymentDaysBegin=").append(paymentDaysBegin);
        sb.append(", paymentDaysEnd=").append(paymentDaysEnd);
        sb.append(", collectionDate=").append(collectionDate);
        sb.append(", realCollectionDate=").append(realCollectionDate);
        sb.append(", receiptNumber=").append(receiptNumber);
        sb.append(", payMethod=").append(payMethod);
        sb.append(", otherPayMethod=").append(otherPayMethod);
        sb.append(", payFlowNo=").append(payFlowNo);
        sb.append(", rentalPrice=").append(rentalPrice);
        sb.append(", tax=").append(tax);
        sb.append(", operationUser=").append(operationUser);
        sb.append(", remark=").append(remark);
        sb.append(", reserve1=").append(reserve1);
        sb.append(", reserve2=").append(reserve2);
        sb.append(", reserve3=").append(reserve3);
        sb.append(", reserve4=").append(reserve4);
        sb.append(", reserve5=").append(reserve5);
        sb.append(", delFlg=").append(delFlg);
        sb.append(", createUserid=").append(createUserid);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUserid=").append(updateUserid);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}